package com.kamistoat.meimeimall.meimeimallmember.config;

import com.alibaba.fastjson.parser.ParserConfig;
import com.alibaba.fastjson.support.spring.GenericFastJsonRedisSerializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.serializer.RedisSerializer;

@Configuration
public class RedisSerializerConfig {
    /**
     * 想要自定义序列化机制，同样需要自定义Bean
     */
    @Bean
    public RedisSerializer<Object> springSessionDefaultRedisSerializer() {
        // ParserConfig.getGlobalInstance().addAccept("org.springframework.web.servlet.");
        return new GenericFastJsonRedisSerializer();
    }
}
